home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / m2 / m2_part1.lha / modula / src / GadTools.def < prev    next >
Text File  |  1994-07-30  |  20KB  |  543 lines

  1. DEFINITION FOR LIBRARY MODULE GadTools ;
  2.  
  3. FROM SYSTEM    IMPORT ADDRESS, LONGSET, STRING ;
  4. FROM Exec    IMPORT MsgPortPtr, LibraryPtr ;
  5. FROM Intuition    IMPORT GadgetPtr, MenuPtr, MenuItemPtr, RequesterPtr,
  6.                DrawInfoPtr, WindowPtr, ScreenPtr, IntuiMessagePtr ;
  7.  
  8. FROM Utility    IMPORT TAG_USER, Tag, TagItemPtr ;
  9. FROM Graphics    IMPORT RastPortPtr, Rectangle, TextAttrPtr ;
  10.  
  11. FROM Intuition    IMPORT IDCMP_GADGETUP, IDCMP_GADGETDOWN, IDCMP_INTUITICKS,
  12.                IDCMP_MOUSEBUTTONS, IDCMP_MOUSEMOVE, MENUENABLED,
  13.                ITEMENABLED, COMMSEQ, ITEMTEXT, HIGHFLAGS ;
  14.  
  15. (* The kinds (almost classes) of gadgets that GadTools supports. *)
  16. (* Use these identifiers when calling CreateGadgetA()         *)
  17.  
  18. TYPE
  19.   NewGadgetPtr    = POINTER TO NewGadget      ;
  20.   NewMenuPtr    = POINTER TO NewMenu      ;
  21.   LVDrawMsgPtr    = POINTER TO LVDrawMsgPtr ;
  22.   VisualInfoPtr    = POINTER TO RECORD END ;
  23.  
  24. CONST
  25.   GENERIC_KIND    = 0 ;
  26.   BUTTON_KIND    = 1 ;
  27.   CHECKBOX_KIND    = 2 ;
  28.   INTEGER_KIND    = 3 ;
  29.   LISTVIEW_KIND    = 4 ;
  30.   MX_KIND    = 5 ;
  31.   NUMBER_KIND    = 6 ;
  32.   CYCLE_KIND    = 7 ;
  33.   PALETTE_KIND    = 8 ;
  34.   SCROLLER_KIND    = 9 ;
  35.  
  36. (* Kind number 10 is reserved *)
  37.  
  38.   SLIDER_KIND    = 11 ;
  39.   STRING_KIND    = 12 ;
  40.   TEXT_KIND    = 13 ;
  41.  
  42.   NUM_KINDS    = 14 ;
  43.  
  44. (*------------------------------------------------------------------------*)
  45.  
  46. (* 'Or' the appropriate set together for your Window IDCMPFlags: *)
  47.  
  48.   ARROWIDCMP    = IDCMP_GADGETUP+IDCMP_GADGETDOWN+IDCMP_INTUITICKS+
  49.             IDCMP_MOUSEBUTTONS ;
  50.  
  51.   BUTTONIDCMP    = IDCMP_GADGETUP ;
  52.   CHECKBOXIDCMP    = IDCMP_GADGETUP ;
  53.   INTEGERIDCMP    = IDCMP_GADGETUP ;
  54.   LISTVIEWIDCMP    = IDCMP_GADGETUP+IDCMP_GADGETDOWN+IDCMP_MOUSEMOVE+ARROWIDCMP;
  55.  
  56.   MXIDCMP    = IDCMP_GADGETDOWN ;
  57.   NUMBERIDCMP    = 0 ;
  58.   CYCLEIDCMP    = IDCMP_GADGETUP ;
  59.   PALETTEIDCMP    = IDCMP_GADGETUP ;
  60.  
  61. (* Use ARROWIDCMP+SCROLLERIDCMP if your scrollers have arrows: *)
  62.   SCROLLERIDCMP    = IDCMP_GADGETUP+IDCMP_GADGETDOWN+IDCMP_MOUSEMOVE ;
  63.   SLIDERIDCMP    = IDCMP_GADGETUP+IDCMP_GADGETDOWN+IDCMP_MOUSEMOVE ;
  64.   STRINGIDCMP    = IDCMP_GADGETUP ;
  65.  
  66.   TEXTIDCMP    = 0 ;
  67.  
  68. (*------------------------------------------------------------------------*)
  69.  
  70. (* Generic NewGadget used by several of the gadget classes: *)
  71.  
  72. TYPE
  73.   NewGadget = RECORD
  74.     ng_LeftEdge   : INTEGER ;    (* gadget position             *)
  75.     ng_TopEdge      : INTEGER ;    (* gadget position             *)
  76.     ng_Width      : INTEGER ;    (* gadget size                *)
  77.     ng_Height      : INTEGER ;    (* gadget size                *)
  78.     ng_GadgetText : STRING  ;    (* gadget label                *)
  79.     ng_TextAttr   : TextAttrPtr;(* desired font for gadget label    *)
  80.     ng_GadgetID   : CARDINAL ;    (* gadget ID                *)
  81.     ng_Flags      : LONGSET  ;    (* see below                *)
  82.     ng_VisualInfo : ADDRESS  ;  (* Set to retval of GetVisualInfo()    *)
  83.     ng_UserData   : ADDRESS  ;    (* gadget UserData            *)
  84.   END ;
  85.  
  86. (* ng_Flags control certain aspects of the gadget.  The first five control    *)
  87. (* the placement of the descriptive text.  Each gadget kind has its default,  *)
  88. (* which is usually PLACETEXT_LEFT.  Consult the autodocs for details.          *)
  89.  
  90. CONST
  91.   PLACETEXT_LEFT  = {0} ; (* Right-align text on left side *)
  92.   PLACETEXT_RIGHT = {1} ; (* Left-align text on right side *)
  93.   PLACETEXT_ABOVE = {2} ; (* Center text above           *)
  94.   PLACETEXT_BELOW = {3} ; (* Center text below           *)
  95.   PLACETEXT_IN      = {4} ; (* Center text on           *)
  96.  
  97.   NG_HIGHLABEL      = {5} ; (* Highlight the label       *)
  98.  
  99. (*------------------------------------------------------------------------*)
  100.  
  101. (* Fill out an array of these and pass that to CreateMenus(): *)
  102.  
  103. TYPE
  104.   NewMenu = RECORD
  105.     nm_Type        : SHORTCARD ; (* See below            *)
  106.     (* Compiler inserts a PAD byte here *)
  107.     nm_Label        : STRING  ;
  108.     nm_CommKey        : STRING  ; (* MenuItem Command Key Equiv    *)
  109.     nm_Flags        : BITSET  ; (* Menu or MenuItem flags (see note)*)
  110.     nm_MutualExclude    : LONGINT ; (* MenuItem MutualExclude word    *)
  111.     nm_UserData        : ADDRESS ; (* For your own use, see note    *)
  112.   END ;
  113.  
  114. (* Needed only by inside IM_ definitions below *)
  115. CONST
  116.   MENU_IMAGE = 128 ;
  117.  
  118. (* nm_Type determines what each NewMenu structure corresponds to.     *)
  119. (* for the NM_TITLE, NM_ITEM, and NM_SUB values, nm_Label should     *)
  120. (* be a text string to use for that menu title, item, or sub-item.     *)
  121. (* For IM_ITEM or IM_SUB, set nm_Label to point at the Image structure   *)
  122. (* you wish to use for this item or sub-item.                 *)
  123. (* NOTE: At present, you may only use conventional images.         *)
  124. (* Custom images created from Intuition image-classes do not work.     *)
  125.  
  126.   NM_TITLE    = 1 ; (* Menu header        *)
  127.   NM_ITEM    = 2 ; (* Textual menu item    *)
  128.   NM_SUB    = 3 ; (* Textual menu sub-item    *)
  129.  
  130.   IM_ITEM    = NM_ITEM+MENU_IMAGE ; (* Graphical menu item      *)
  131.   IM_SUB    = NM_SUB+MENU_IMAGE ;  (* Graphical menu sub-item *)
  132.  
  133. (* The NewMenu array should be terminated with a NewMenu whose    *)
  134. (* nm_Type equals NM_END.                      *)
  135.  
  136.   NM_END    = 0 ;    (* End of NewMenu array *)
  137.  
  138. (* Starting with V39, GadTools will skip any NewMenu entries whose*)
  139. (* nm_Type field has the NM_IGNORE bit set.              *)
  140.  
  141.   NM_IGNORE    = 64 ;
  142.  
  143. (* nm_Label should be a text string for textual items, a pointer  *)
  144. (* to an Image structure for graphical menu items, or the special *)
  145. (* constant NM_BARLABEL, to get a separator bar.          *)
  146.  
  147.   NM_BARLABEL    = STRING(-1) ;
  148.  
  149. (* The nm_Flags field is used to fill out either the Menu->Flags or    *)
  150. (* MenuItem->Flags field.  Note that the sense of the MENUENABLED or    *)
  151. (* ITEMENABLED bit is inverted between this use and Intuition's use,    *)
  152. (* in other words, NewMenus are enabled by default.  The following    *)
  153. (* labels are provided to disable them:                    *)
  154.  
  155.   NM_MENUDISABLED = MENUENABLED ;
  156.   NM_ITEMDISABLED = ITEMENABLED ;
  157.  
  158. (* New for V39:  NM_COMMANDSTRING.  For a textual MenuItem or SubItem,     *)
  159. (* point nm_CommKey at an arbitrary string, and set the NM_COMMANDSTRING *)
  160. (* flag.                                 *)
  161.  
  162.   NM_COMMANDSTRING = COMMSEQ ;
  163.  
  164. (* The following are pre-cleared (COMMSEQ, ITEMTEXT, and HIGHxxx are set *)
  165. (* later as appropriate):                         *)
  166. (* Under V39, the COMMSEQ flag bit is not cleared, since it now has     *)
  167. (* meaning.                                 *)
  168.  
  169.   NM_FLAGMASK         = {0..7}-(COMMSEQ+ITEMTEXT+HIGHFLAGS) ;
  170.   NM_FLAGMASK_V39    = {0..7}-(ITEMTEXT+HIGHFLAGS) ;
  171.  
  172. (* You may choose among CHECKIT, MENUTOGGLE, and CHECKED.        *)
  173. (* Toggle-select menuitems are of type CHECKIT|MENUTOGGLE, along    *)
  174. (* with CHECKED if currently selected.    Mutually exclusive ones        *)
  175. (* are of type CHECKIT, and possibly CHECKED too.  The nm_MutualExclude    *)
  176. (* is a bit-wise representation of the items excluded by this one,    *)
  177. (* so in the simplest case (choose 1 among n), these flags would be    *)
  178. (* ~1, ~2, ~4, ~8, ~16, etc.  See the Intuition Menus chapter.        *)
  179.  
  180. (* A UserData pointer can be associated with each Menu and MenuItem structure.*)
  181. (* The CreateMenus() call allocates space for a UserData after each          *)
  182. (* Menu or MenuItem (header, item or sub-item).  You should use the          *)
  183. (* GTMENU_USERDATA() or GTMENUITEM_USERDATA() functions to extract it.          *)
  184.  
  185.   PROCEDURE GTMENU_USERDATA( menu : MenuPtr ) : ADDRESS ;
  186.   PROCEDURE GTMENUITEM_USERDATA( menuitem : MenuItemPtr ) : ADDRESS ;
  187.  
  188. (* Here is an old one for compatibility.  Do not use in new code! *)
  189. (*  PROCEDURE MENU_USERDATA( ? ) : ADDRESS ;              *)
  190.  
  191. CONST
  192.   (* These return codes can be obtained through the GTMN_SecondaryError tag *)
  193.   GTMENU_TRIMMED  = 000000001H ;  (* Too many menus, items, or subitems,    *)
  194.                   (* menu has been trimmed down            *)
  195.  
  196.   GTMENU_INVALID  = 000000002H ;  (* Invalid NewMenu array    *)
  197.   GTMENU_NOMEM      = 000000003H ;  (* Out of memory        *)
  198.  
  199. (*------------------------------------------------------------------------*)
  200.  
  201. (* Starting with V39, checkboxes and mx gadgets can be scaled to your      *)
  202. (* specified gadget width/height.  Use the new GTCB_Scaled or GTMX_Scaled *)
  203. (* tags, respectively.    Under V37, and by default in V39, the imagery     *)
  204. (* is of the following fixed size:                      *)
  205.  
  206. (* MX gadget default dimensions: *)
  207.    MX_WIDTH       = 17 ;
  208.    MX_HEIGHT       =  9 ;
  209.  
  210. (* Checkbox default dimensions: *)
  211.    CHECKBOX_WIDTH  = 26 ;
  212.    CHECKBOX_HEIGHT = 11 ;
  213.  
  214. (*------------------------------------------------------------------------*)
  215.  
  216. (* Tags for GadTools functions: *)
  217.  
  218.   GT_TagBase        = TAG_USER + 080000H ;
  219.  
  220.   GTVI_NewWindow    = GT_TagBase+1 ;  (* Unused                  *)
  221.   GTVI_NWTags        = GT_TagBase+2 ;  (* Unused                  *)
  222.  
  223.   GT_Private0        = GT_TagBase+3 ;  (* (private)                  *)
  224.  
  225.   GTCB_Checked        = GT_TagBase+4 ;  (* State of checkbox              *)
  226.  
  227.   GTLV_Top        = GT_TagBase+5 ;  (* Top visible one in listview      *)
  228.   GTLV_Labels        = GT_TagBase+6 ;  (* List to display in listview      *)
  229.   GTLV_ReadOnly        = GT_TagBase+7 ;  (* TRUE if listview is to be read-o *)
  230.   GTLV_ScrollWidth    = GT_TagBase+8 ;  (* Width of scrollbar              *)
  231.  
  232.   GTMX_Labels        = GT_TagBase+9 ;  (* NULL-terminated array of labels  *)
  233.   GTMX_Active        = GT_TagBase+10 ; (* Active one in mx gadget          *)
  234.  
  235.   GTTX_Text        = GT_TagBase+11 ; (* Text to display              *)
  236.   GTTX_CopyText        = GT_TagBase+12 ; (* Copy text label instead of          *)
  237.                       (* referencing it              *)
  238.  
  239.   GTNM_Number        = GT_TagBase+13 ; (* Number to display              *)
  240.  
  241.   GTCY_Labels        = GT_TagBase+14 ; (* NULL-terminated array of labels  *)
  242.   GTCY_Active        = GT_TagBase+15 ; (* The active one in the cycle gad  *)
  243.  
  244.   GTPA_Depth        = GT_TagBase+16 ; (* Number of bitplanes in palette   *)
  245.   GTPA_Color        = GT_TagBase+17 ; (* Palette color              *)
  246.   GTPA_ColorOffset    = GT_TagBase+18 ; (* First color to use in palette    *)
  247.   GTPA_IndicatorWidth    = GT_TagBase+19 ; (* Width of current-color indicator *)
  248.   GTPA_IndicatorHeight    = GT_TagBase+20 ; (* Height of current-color indicator*)
  249.  
  250.   GTSC_Top        = GT_TagBase+21 ; (* Top visible in scroller          *)
  251.   GTSC_Total        = GT_TagBase+22 ; (* Total in scroller area          *)
  252.   GTSC_Visible        = GT_TagBase+23 ; (* Number visible in scroller          *)
  253.   GTSC_Overlap        = GT_TagBase+24 ; (* Unused                  *)
  254.  
  255. (*  GT_TagBase+25 through GT_TagBase+37 are reserved *)
  256.  
  257.   GTSL_Min        = GT_TagBase+38 ; (* Slider min value              *)
  258.   GTSL_Max        = GT_TagBase+39 ; (* Slider max value              *)
  259.   GTSL_Level        = GT_TagBase+40 ; (* Slider level              *)
  260.   GTSL_MaxLevelLen    = GT_TagBase+41 ; (* Max length of printed level      *)
  261.   GTSL_LevelFormat    = GT_TagBase+42 ; (* Format string for level          *)
  262.   GTSL_LevelPlace    = GT_TagBase+43 ; (* Where level should be placed     *)
  263.   GTSL_DispFunc        = GT_TagBase+44 ; (* Callback for number calculation  *)
  264.                       (* before display              *)
  265.  
  266.   GTST_String        = GT_TagBase+45 ; (* String gadget's displayed string *)
  267.   GTST_MaxChars        = GT_TagBase+46 ; (* Max length of string          *)
  268.  
  269.   GTIN_Number        = GT_TagBase+47 ; (* Number in integer gadget          *)
  270.   GTIN_MaxChars        = GT_TagBase+48 ; (* Max number of digits          *)
  271.  
  272.   GTMN_TextAttr        = GT_TagBase+49 ; (* MenuItem font TextAttr          *)
  273.   GTMN_FrontPen        = GT_TagBase+50 ; (* MenuItem text pen color          *)
  274.  
  275.   GTBB_Recessed        = GT_TagBase+51 ; (* Make BevelBox recessed          *)
  276.  
  277.   GT_VisualInfo        = GT_TagBase+52 ; (* result of VisualInfo call          *)
  278.  
  279.   GTLV_ShowSelected    = GT_TagBase+53 ; (* show selected entry beneath      *)
  280.                       (* listview, set tag data = NULL for*)
  281.                       (* display-only, or pointer          *)
  282.                       (* to a string gadget you've created*)
  283.  
  284.   GTLV_Selected        = GT_TagBase+54 ; (* Set ordinal number of selected   *)
  285.                       (* entry in the list              *)
  286.  
  287.   GT_Reserved1        = GT_TagBase+56 ; (* Reserved for future use          *)
  288.  
  289.   GTTX_Border        = GT_TagBase+57 ; (* Put a border around          *)
  290.                       (* Text-display gadgets          *)
  291.  
  292.   GTNM_Border        = GT_TagBase+58 ; (* Put a border around          *)
  293.                       (* Number-display gadgets          *)
  294.  
  295.   GTSC_Arrows        = GT_TagBase+59 ; (* Specify size of arrows for          *)
  296.                         (* scroller                  *)
  297.  
  298.   GTMN_Menu        = GT_TagBase+60 ; (* Pointer to Menu for use by          *)
  299.                       (* LayoutMenuItems()              *)
  300.  
  301.   GTMX_Spacing        = GT_TagBase+61 ; (* Added to font height to figure   *)
  302.                         (* spacing between mx choices.      *)
  303.                         (* Use this instead of          *)
  304.                         (* LAYOUTA_SPACING for mx gadgets.  *)
  305.  
  306. (* New to V37 GadTools.  Ignored by GadTools V36 *)
  307.   GTMN_FullMenu        = GT_TagBase+62 ; (* Asks CreateMenus to validate that*)
  308.                       (* this is a complete menu structure*)
  309.  
  310.   GTMN_SecondaryError    = GT_TagBase+63 ; (* ti_Data is a pointer          *)
  311.                       (* to a ULONG to receive error      *)
  312.                       (* reports from CreateMenus()          *)
  313.  
  314.   GT_Underscore        = GT_TagBase+64 ; (* ti_Data points to the symbol     *)
  315.                       (* that preceeds the character      *)
  316.                       (* you'd like to underline in a     *)
  317.                       (* gadget label              *)
  318.  
  319.  
  320.   GTST_EditHook        = GT_TagBase+55 ;  (* String EditHook *)
  321.  
  322.   GTIN_EditHook        = GTST_EditHook ;(* Same ; thing, different name,    *)
  323.                          (* just to round out INTEGER_KIND   *)
  324.                          (* gadgets                 *)
  325.  
  326. (* New to V39 GadTools.  Ignored by GadTools V36 and V37 *)
  327.   GTMN_Checkmark    = GT_TagBase+65 ; (* ti_Data is checkmark img to use *)
  328.   GTMN_AmigaKey        = GT_TagBase+66 ; (* ti_Data is Amiga-key img to use *)
  329.   GTMN_NewLookMenus     = GT_TagBase+67 ; (* ti_Data is boolean             *)
  330.  
  331. (* New to V39 GadTools.  Ignored by GadTools V36 and V37.    *)
  332. (* Set to TRUE if you want the checkbox or mx image scaled to    *)
  333. (* the gadget width/height you specify.  Defaults to FALSE,    *)
  334. (* for compatibility.                        *)
  335.  
  336.   GTCB_Scaled        = GT_TagBase+68 ; (* ti_Data is boolean              *)
  337.   GTMX_Scaled        = GT_TagBase+69 ; (* ti_Data is boolean              *)
  338.  
  339.   GTPA_NumColors    = GT_TagBase+70 ; (* Number of colors in palette      *)
  340.  
  341.   GTMX_TitlePlace    = GT_TagBase+71 ; (* Where to put the title           *)
  342.  
  343.   GTTX_FrontPen        = GT_TagBase+72 ; (* Text color in TEXT_KIND gad      *)
  344.   GTTX_BackPen        = GT_TagBase+73 ; (* Bgrnd color in TEXT_KIND gad     *)
  345.   GTTX_Justification    = GT_TagBase+74 ; (* See GTJ_#? constants          *)
  346.  
  347.   GTNM_FrontPen        = GT_TagBase+72 ; (* Text color in NUMBER_KIND gad    *)
  348.   GTNM_BackPen        = GT_TagBase+73 ; (* Bgrnd color in NUMBER_KIND gad   *)
  349.   GTNM_Justification    = GT_TagBase+74 ; (* See GTJ_#? constants          *)
  350.   GTNM_Format        = GT_TagBase+75 ; (* Formatting string for number     *)
  351.   GTNM_MaxNumberLen    = GT_TagBase+76 ; (* Maximum length of number          *)
  352.  
  353.   GTBB_FrameType    = GT_TagBase+77 ; (* defines what kind of boxes       *)
  354.                       (* DrawBevelBox() renders. See      *)
  355.                       (* the BBFT_#? constants for          *)
  356.                       (* possible values              *)
  357.  
  358.   GTLV_MakeVisible    = GT_TagBase+78 ; (* Make this item visible          *)
  359.   GTLV_ItemHeight    = GT_TagBase+79 ; (* Height of an individual item     *)
  360.  
  361.   GTSL_MaxPixelLen    = GT_TagBase+80 ; (* Max pixel size of level display  *)
  362.   GTSL_Justification    = GT_TagBase+81 ; (* how should the level be displayed*)
  363.  
  364.   GTPA_ColorTable    = GT_TagBase+82 ; (* colors to use in palette          *)
  365.  
  366.   GTLV_CallBack        = GT_TagBase+83 ; (* general-purpose listview callback*)
  367.   GTLV_MaxPen        = GT_TagBase+84 ; (* maximum pen number, callback use *)
  368.  
  369.   GTTX_Clipped        = GT_TagBase+85 ; (* make a TEXT_KIND clip text          *)
  370.   GTNM_Clipped        = GT_TagBase+85 ; (* make a NUMBER_KIND clip text     *)
  371.  
  372. (* Old definition, now obsolete: *)
  373.   GT_Reserved0        = GTST_EditHook    ;
  374.  
  375. (*------------------------------------------------------------------------*)
  376.  
  377. (* Justification types for GTTX_Justification and GTNM_Justification tags *)
  378.   GTJ_LEFT   = 0 ;
  379.   GTJ_RIGHT  = 1 ;
  380.   GTJ_CENTER = 2 ;
  381.  
  382. (*------------------------------------------------------------------------*)
  383.  
  384. (* Bevel box frame types for GTBB_FrameType tag *)
  385.   BBFT_BUTTON        = 1 ; (* Standard button gadget box *)
  386.   BBFT_RIDGE        = 2 ; (* Standard string gadget box *)
  387.   BBFT_ICONDROPBOX    = 3 ; (* Standard icon drop box        *)
  388.  
  389. (*------------------------------------------------------------------------*)
  390.  
  391. (* Typical suggested spacing between "elements": *)
  392.   INTERWIDTH    = 8 ;
  393.   INTERHEIGHT    = 4 ;
  394.  
  395. (*------------------------------------------------------------------------*)
  396.  
  397. (* "NWay" is an old synonym for cycle gadgets *)
  398.   NWAY_KIND    = CYCLE_KIND  ;
  399.   NWAYIDCMP    = CYCLEIDCMP  ;
  400.   GTNW_Labels    = GTCY_Labels ;
  401.   GTNW_Active    = GTCY_Active ;
  402.  
  403. (*------------------------------------------------------------------------*)
  404.  
  405. (* These two definitions are obsolete, but are here for backwards    *)
  406. (* compatibility.  You never need to worry about these:            *)
  407.  
  408.   GADTOOLBIT    = {15} ;
  409.  
  410. (* Use this mask to isolate the user part: *)
  411.   GADTOOLMASK    = {0..14,16..31} ;
  412.  
  413. (*------------------------------------------------------------------------*)
  414.  
  415. (* These definitions are for the GTLV_CallBack tag *)
  416.  
  417.   (* The different types of messages that a listview callback hook can see *)
  418.   LV_DRAW       = 0202H ; (* draw yourself, with state *)
  419.  
  420. (* Possible return values from a callback hook *)
  421.   LVCB_OK       = 0 ; (* callback understands this message type    *)
  422.   LVCB_UNKNOWN  = 1 ; (* callback does not understand this message *)
  423.  
  424. (* states for LVDrawMsg.lvdm_State *)
  425.   LVR_NORMAL            = 0 ; (* the usual        *)
  426.   LVR_SELECTED            = 1 ; (* for selected gadgets    *)
  427.   LVR_NORMALDISABLED    = 2 ; (* for disabled gadgets    *)
  428.   LVR_SELECTEDDISABLED  = 8 ; (* disabled and selected    *)
  429.  
  430. (* structure of LV_DRAW messages, object is a Exec.NodePtr *)
  431. TYPE
  432.   LVDrawMsg = RECORD
  433.     lvdm_MethodID : LONGINT     ; (* LV_DRAW            *)
  434.     lvdm_RastPort : RastPortPtr ; (* where to render to        *)
  435.     lvdm_DrawInfo : DrawInfoPtr ; (* useful to have around    *)
  436.     lvdm_Bounds   : Rectangle   ; (* limits of where to render    *)
  437.     lvdm_State    : LONGINT     ; (* how to render        *)
  438.   END ;
  439.  
  440. (*------------------------------------------------------------------------*)
  441.  
  442. VAR
  443.   GadToolsBase : LibraryPtr ;
  444.  
  445. (*--- functions in V36 or higher (Release 2.0) ---*)
  446.  
  447. (* Gadget Functions *)
  448.  
  449. PROCEDURE CreateGadgetA(        kind : LONGINT ;
  450.                      gad : GadgetPtr ;
  451.              VAR      ng : NewGadget ; (* in *)
  452.                  taglist : TagItemPtr ) : GadgetPtr ;
  453.  
  454. PROCEDURE CreateGadget(    kind    : LONGINT ;
  455.                 gad    : GadgetPtr ;
  456.             VAR  ng    : NewGadget ; (* in *)
  457.                 tag    : Tag ; .. ) : GadgetPtr ;
  458.  
  459. PROCEDURE FreeGadgets( gad : GadgetPtr ) ;
  460.  
  461. PROCEDURE GT_SetGadgetAttrsA( gad : GadgetPtr ;
  462.                   win : WindowPtr ;
  463.                   req : RequesterPtr ;
  464.                   taglist : TagItemPtr ) ;
  465.  
  466. PROCEDURE GT_SetGadgetAttrs( gad : GadgetPtr ;
  467.                  win : WindowPtr ;
  468.                  req : RequesterPtr ;
  469.                  tag : Tag ; .. ) ;
  470.  
  471. (* Menu functions *)
  472.  
  473. PROCEDURE CreateMenusA( newmenu : ARRAY OF NewMenu ;
  474.                         taglist : TagItemPtr ) : MenuPtr;
  475.  
  476. PROCEDURE CreateMenus ( newmenu : ARRAY OF NewMenu ;
  477.             tag : Tag ; .. ) : MenuPtr ;
  478.  
  479. PROCEDURE FreeMenus( menu : MenuPtr ) ;
  480.  
  481. PROCEDURE LayoutMenuItemsA( firstitem    : MenuItemPtr ;
  482.                 vi        : VisualInfoPtr ;
  483.                 taglist    : TagItemPtr ) : BOOLEAN ;
  484.  
  485. PROCEDURE LayoutMenuItems( firstitem : MenuItemPtr ;
  486.                vi         : VisualInfoPtr ;
  487.                tag         : Tag ; .. ) : BOOLEAN ;
  488.  
  489. PROCEDURE LayoutMenusA( firstmenu : MenuPtr ;
  490.                 vi      : VisualInfoPtr ;
  491.                 taglist      : TagItemPtr ) : BOOLEAN ;
  492.  
  493. PROCEDURE LayoutMenus( firstmenu : MenuPtr ;
  494.                vi     : VisualInfoPtr ;
  495.                tag     : Tag ; .. ) : BOOLEAN ;
  496.  
  497. (* Misc Event-Handling Functions *)
  498.  
  499. PROCEDURE GT_GetIMsg( iport : MsgPortPtr ) : IntuiMessagePtr ;
  500. PROCEDURE GT_ReplyIMsg( imsg : IntuiMessagePtr ) ;
  501. PROCEDURE GT_RefreshWindow( win : WindowPtr ; req : RequesterPtr ) ;
  502. PROCEDURE GT_BeginRefresh( win : WindowPtr ) ;
  503. PROCEDURE GT_EndRefresh( win : WindowPtr ; complete : LONGINT ) ;
  504.  
  505. PROCEDURE GT_FilterIMsg( imsg : IntuiMessagePtr ) : IntuiMessagePtr ;
  506. PROCEDURE GT_PostFilterIMsg( imsg : IntuiMessagePtr ) : IntuiMessagePtr ;
  507.  
  508. PROCEDURE CreateContext( VAR glistptr : GadgetPtr ) : GadgetPtr ;
  509.  
  510. (* Rendering Functions *)
  511.  
  512. PROCEDURE DrawBevelBoxA( rport : RastPortPtr ;
  513.              left, top, width, height : LONGINT ;
  514.              tagList : TagItemPtr ) ;
  515.  
  516. PROCEDURE DrawBevelBox( rport : RastPortPtr ;
  517.             left, top, width, height : LONGINT ;
  518.             tag1 : Tag ; .. ) ;
  519.  
  520. (* Visuals Functions *)
  521.  
  522. PROCEDURE GetVisualInfoA( screen : ScreenPtr ;
  523.              taglist : TagItemPtr ) : ADDRESS ;
  524.  
  525. PROCEDURE GetVisualInfo( screen : ScreenPtr ;
  526.              tag1 : Tag ; .. ) : ADDRESS ;
  527.  
  528. PROCEDURE FreeVisualInfo( vi : VisualInfoPtr ) ;
  529.  
  530. (*--- functions in V39 or higher (Release 3) ---*)
  531.  
  532. PROCEDURE GT_GetGadgetAttrsA( gad     : GadgetPtr ;
  533.                   win     : WindowPtr ;
  534.                   req     : RequesterPtr ;
  535.                   taglist : TagItemPtr ) : LONGINT ;
  536.  
  537. PROCEDURE GT_GetGadgetAttrs( gad : GadgetPtr ;
  538.                  win : WindowPtr ;
  539.                  req : RequesterPtr ;
  540.                  tag : Tag ; .. ) : LONGINT ;
  541.  
  542. END GadTools.
  543.